/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gestiontienda;

import gestiontienda.dataaccess.daofactory.DaoFactory;
import gestiontienda.dataaccess.daofactory.HibernateDaoFactory;

/**
 *
 * @author igorov
 */
public class GenerateFactory {

    private static DaoFactory instance;
    private static DaoFactory[] factories = {new HibernateDaoFactory()};
    
    private GenerateFactory(int idx) {
        
    }
    
    private static DaoFactory obtenerFactory(int idx) {
        return factories[idx];
    }

    public static DaoFactory getInstance(int idx) {

        if (instance == null) {
            instance = obtenerFactory(idx);
        }
        return instance;
    }
}
